package com.guomao.demof;

import com.guomao.demoa.Person;

public class PersonDemo {

    public static void main(String[] args) {

        PersonBuilder pb1 = new PersonBuilder() {
            @Override
            public Person build(String name, int age) {
                return new Person(name, age);
            }
        };

        PersonBuilder pb2 = (String name, int age) -> {
            return new Person(name, age);
        };

        PersonBuilder pb3 = (name, age) -> new Person(name, age);
        PersonBuilder pb4 = Person::new;
    }
}
